package com.coder.service;

import java.io.BufferedReader;
import java.io.File;
import java.io.FileReader;
import java.io.FileWriter;
import java.io.IOException;
import java.io.PrintWriter;

import com.coder.utils.DecodeUtil;
import com.coder.zexception.ServerErrorException;

public class Test {

	//C:\Users\dream\Desktop\myprogect\bluesky
	public static String path = System.getProperty("user.dir");
	
	public int t;
	
	public static void readConvertWrite() throws IOException{
		File file = new File(path+"/data_copy.txt");
		File out = new File(path+"/result.txt");
		
		BufferedReader br = new BufferedReader(new FileReader(file));
		PrintWriter pw = new PrintWriter(new FileWriter(out));
		
		String line = "";
		
		while((line=br.readLine())!=null){
			pw.println(DecodeUtil.convertHex2float(line));
		}
		br.close();
		pw.flush();
		pw.close();
	}

	public static void a() throws ServerErrorException{
		throw(new ServerErrorException("error"));
	}
	 
	public static void b(){
		
		try{
			a();
		}catch(Exception e){
			System.out.println("b");
			e.printStackTrace();
		}
	}
	
	public static void c(){
		
		try{
			b();
		}catch(Exception e){
			System.out.println("c");
			e.printStackTrace();
		}
	}
	
	public static void main(String[] args) throws IOException {
		
		c();
	}

}
